import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Admin from '@/components/admin/Admin'
import ManageNewWord from '@/components/admin/ManageNewWord'
import ManageNewSentence from '@/components/admin/ManageNewSentence'
import PublishSentence from '@/components/admin/PublishSentence'
import PublishWord from '@/components/admin/PublishWord'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      label: '首页',
      component: Home
    },
    {
      path: '/admin',
      name: 'Admin',
      component: Admin,
      label:'管理员模块',
      children: [
        {
          path: 'manageNewWord',
          name: 'ManageNewWord',
          label:'审核词汇',
          show: true,
          author:['student','instructor','admin'],
          component: ManageNewWord
        },
        {
          path: 'manageNewSentence',
          name: 'ManageNewSentence',
          label:'审核句型',
          show: true,
          author:['student','instructor','admin'],
          component: ManageNewSentence
        },
        {
          path: 'publishWord',
          name: 'PublishWord',
          label:'发布词汇',
          show: true,
          author:['student','instructor','admin'],
          component: PublishWord
        },
        {
          path: 'publishSentence',
          name: 'PublishSentence',
          label:'发布句型',
          show: true,
          author:['student','instructor','admin'],
          component: PublishSentence
        }
      ]
    }
  ]
})
